#pragma once


class CGetRandRomDlg 
	: public CBkDialogImpl<CGetRandRomDlg>
	,public CWHRoundRectFrameHelper<CGetRandRomDlg>
{
public:
	CGetRandRomDlg()
		: CBkDialogImpl<CGetRandRomDlg>(IDR_BK_GETRANDROM_DLG)
	{
		m_strRandom = _T("");
	}

	~CGetRandRomDlg(void)
	{		
	}
	void FreePasswords();
protected:
	LRESULT		OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	BOOL		OnInitDialog(HWND wParam, LPARAM lParam);	
	LRESULT		OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	void		OnBkBtnClose();
	void		OnOK();	
	
	void OnBeginMouseInput();

	LRESULT OnMouseMove(UINT nFlags, CPoint point);
public:
	
	CString	m_strRandom;
	RECT m_rect;

	BOOL m_bMouseActive;
	POINT m_points[100];
	DWORD m_dwCurPoint;

	unsigned char m_pFinalRandom[32];
public:
	BK_NOTIFY_MAP(IDC_RICHVIEW_WIN);
		BK_NOTIFY_ID_COMMAND(IDC_BTN_SYS_CLOSE,					OnBkBtnClose)
		BK_NOTIFY_ID_COMMAND(IDC_BTN_DLG_OK,			OnOK)
		BK_NOTIFY_ID_COMMAND(IDC_BTN_DLG_CANCEL,		OnBkBtnClose)		
		BK_NOTIFY_ID_COMMAND(IDC_GETRANDROM_BTN_MOUSE,		OnBeginMouseInput)	

	BK_NOTIFY_MAP_END()

	BEGIN_MSG_MAP_EX(CGetRandRomDlg)	
		MSG_BK_NOTIFY(IDC_RICHVIEW_WIN)
		CHAIN_MSG_MAP(CBkDialogImpl<CGetRandRomDlg>)
		CHAIN_MSG_MAP(CWHRoundRectFrameHelper<CGetRandRomDlg>)
		MESSAGE_HANDLER(WM_CREATE,				OnCreate)
		MESSAGE_HANDLER(WM_DESTROY,				OnDestroy)	
		MSG_WM_INITDIALOG(OnInitDialog)	
		MSG_WM_MOUSEMOVE(OnMouseMove)
		MSG_WM_LBUTTONDOWN(OnMouseMove)
		REFLECT_NOTIFICATIONS_EX()
	END_MSG_MAP()		 

private:
	void _init();
	CEdit		m_EditInput;
};

